﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="clr-namespace:ProductManager.WPF.Presentation.Converters"
    xmlns:p="clr-namespace:ProductManager.WPF.Presentation.Properties"
    xmlns:u="clr-namespace:ProductManager.WPF.Presentation.Util">

    <SolidColorBrush x:Key="InvalidControlBrush" Color="#E5B8B7"/>
    <SolidColorBrush x:Key="HeaderTextBrush" Color="#003399"/>


    <!--<Style TargetType="Label">
        <Setter Property="Margin" Value="11,11,0,0"/>
    </Style>-->

    <!--<Style TargetType="Button">
        <Setter Property="MinWidth" Value="73"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="Margin" Value="11,11,0,0"/>
    </Style>-->
    
    <!--<Style TargetType="TextBox">
        <Setter Property="MinHeight" Value="25"/>
        <Setter Property="MinWidth" Value="100"/>
        <Setter Property="Margin" Value="11,11,0,0"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Style.Triggers>
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="Background" Value="{StaticResource InvalidControlBrush}"/>
                <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
            </Trigger>
        </Style.Triggers>
    </Style>-->
    <Style TargetType="TextBox">
        <Style.Triggers>
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="Background" Value="{StaticResource InvalidControlBrush}"/>
                <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="ContentControl" x:Key="ChangeMarker">
        <Setter Property="Visibility" Value="Hidden" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Focusable" Value="False" />
        <Setter Property="ContentTemplate" Value="{DynamicResource ChangedMarkerDataTemplate}" />
        <Setter Property="Margin" Value="-1" />
        <Setter Property="u:ChangeMarker.Entity" Value="{Binding}" />
    </Style>
    <DataTemplate x:Key="ChangedMarkerDataTemplate">
        <Image Source="Images/Edit.png" Width="14" Height="14" ToolTip="{x:Static p:Resources.Edited}" />
    </DataTemplate>

    <!--<Style TargetType="ComboBox">
        <Setter Property="Margin" Value="11,11,0,0"/>
    </Style>-->
    
    <!--<Style TargetType="RadioButton">
        <Setter Property="Margin" Value="11,11,0,0"/>
    </Style>-->
    
    <Style TargetType="MenuItem">
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="False">
                <Setter Property="Opacity" Value="0.6"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="{x:Static ToolBar.ButtonStyleKey}" TargetType="{x:Type Button}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="False">
                <Setter Property="Opacity" Value="0.35"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="HeaderLabel" TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Foreground" Value="{StaticResource HeaderTextBrush}"/>
    </Style>

</ResourceDictionary>